<template>
  <comcard>
    <div slot="title_name">
     
     <el-row>
      <el-form :inline=true :model="formObj">
          <el-form-item label="订单号">
              <el-input type="text" placeholder="订单号" v-model="formObj.orderNo"></el-input>
          </el-form-item>
          <el-form-item label="收货人">
              <el-input type="text" placeholder="收货人" v-model="formObj.consignee"></el-input>
          </el-form-item>
          <el-form-item label="手机号">
              <el-input type="text" placeholder="手机号"  v-model="formObj.phone"></el-input>
          </el-form-item>
          <el-form-item label="订单状态">
              <el-input type="text" placeholder="订单状态"  v-model="formObj.orderState"></el-input>
          </el-form-item>
           <el-form-item label="选择时间">
             <el-time-picker
    is-range

    range-separator="至"
    start-placeholder="开始时间"
    end-placeholder="结束时间"
    placeholder="选择时间范围"
   >
  </el-time-picker>
          </el-form-item>
          <el-form-item>
              <el-button type="primary"  @click="save()">保存</el-button>
          </el-form-item>

      </el-form>

     </el-row>

    </div>
    <div slot="body_name">

    </div>
    
    </comcard>
  
  </comcard>
</template>

<script>
import comcard from "../../components/comcard/index.vue";
import { api_queryOne, api_update } from "../../api/order";
export default {
  data() {
    return {
      formObj: {
        id: "",
        orderNo: "",
        orderTime: "",
        phone: "",
        consignee: "",
        deliverAddress: "",
        deliveryTime: "",
        remarks: "",
        orderAmount: "",
        orderState: "",
      },
    };
  },
  components: {
    comcard,
  },
  mounted() {
    this.queryOne();
  },
  methods: {
    async queryOne() {
      let rst = await api_queryOne({ id: this.$route.query.id });
      console.log(rst);

      this.formObj = rst.data;
    },
    async save() {
      let rst = await api_update(this.formObj);
      console.log(rst);
      this.$router.push("/order/list");
    },
  },
};
</script>

<style lang="less" scoped>
</style>